<%@page import="aptech.eproject.logictics.dao.thinh.*" %>
<%@page import="aptech.logictics.Util,java.util.*,aptech.eproject.logictics.db.*" %>
<%@taglib uri="http://www.zkoss.org/jsp/zul"  prefix="zk"%>
<%@taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<tiles:insert definition=".blankLayout">
    <tiles:put name="content" type="String">
        <zk:page zscriptLanguage="java">
            <zk:include src="/Employee/ManageDelivery/DeliveryNote.zul"></zk:include>
        </zk:page>
        <%
                    int deliveryId = 0;
                    DeliveryStatusManageRemote service = Util.lookupDeliveryStatusService();
                    Delivery d = null;
                    try {
                        deliveryId = Integer.valueOf(request.getParameter("DeliveryID"));
                        d = service.getDelivery(deliveryId);
                    } catch (Exception ex) {
                        response.sendRedirect(request.getContextPath() + "/Employee/ManageDelivery/ManageDeliveryStatus.jsp");
                    }
                    Iterator<aptech.eproject.logictics.db.Package> it = d.getPackages().iterator();
        %>
        <%
                    try {
        %>
        <br/>
        <h3 align="left">List Information about package in the delivery :</h3>
        <table id="one-column-emphasis" summary="2007 Major IT Companies' Profit">
            <colgroup>
                <col class="oce-first" />
            </colgroup>
            <thead>
                <tr>
                    <th scope="col" width="20">No.</th>
                    <th scope="col">Weight</th>
                </tr>
            </thead>
            <tbody>
                <%
                    int no = 0;
                    while (it.hasNext()) {
                        no++;
                        aptech.eproject.logictics.db.Package p = it.next();
                        out.println("<tr>");
                        out.println("<td>" + no + "</td>");
                        out.println("<td>" + p.getWeight() + "</td>");
                        out.println("</tr>");
                    }
                %>
            </tbody>
        </table>
        <h4> Note: Package can be delivery any time in same day!</h4>
        <i><h4>If you want to know more detail information please contact number : (08) 3 5166 881</h4></i>
        <%
                    } catch (Exception e) {
                        response.sendRedirect(request.getContextPath() + "/Employee/ManageDelivery/ManageDeliveryStatus.jsp");
                    }
        %>
    </tiles:put>
</tiles:insert>